#include "iot_gpio.h"
#include "iot_gpio_ex.h"
#include "ebox_manhole_led_7.h"

#define LED_NAME_GPIO_7  7


/* 按照注释要求补全函数功能代码 */
/* 初始化LED */
void ManholeLedInit(void)
{
int ret = IoTGpioInit(LED_NAME_GPIO_7);
    if (ret != 0)
    {
        printf("IoTGpioInit failed :%#x \r\n", ret);
        return;
    }
    /*设置复用为GPIO功能*/
    ret = IoTGpioSetFunc(LED_NAME_GPIO_7, IOT_GPIO_FUNC_GPIO_5_GPIO);
    if (ret != 0)
    {
        printf("IoTGpioSetFunc failed :%#x \r\n", ret);
        return;
    }
	
	/*设置方向为输出*/
    ret = IoTGpioSetDir(LED_NAME_GPIO_7, IOT_GPIO_DIR_OUT);
    if (ret != 0)
    {
        printf("IoTGpioSetDir failed :%#x \r\n", ret);
        return;
    }
	printf("ManholeLedInit success!\r\n");
}

/* 按照注释要求补全函数功能代码 */
/* 根据入参state点亮或熄灭LED灯 */
void ManholeLedCtrl(u32 state)
{
	IoTGpioSetOutputVal(LED_NAME_GPIO_7, state);
}